﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
  public class Complex 
  {
    public Complex(int real, int imag) 
    {
      this.real = real;
      this.imag = imag;//X
    }
    
    private int real;
    private int imag;

    public static Complex operator +(Complex c1, Complex c2) 
    {
      Complex c3 = new Complex(c1.real + c2.real, c1.imag + c2.imag);

      return c3;
    }

    public static Complex operator ++(Complex c1) 
    {
      Complex newComplex = new Complex(c1.real + 1, c1.imag + 1);

      return newComplex;
    }

    //true
    public static bool operator ==(Complex c1, Complex c2) 
    {
      return ((c1.real == c2.real) && (c1.imag == c2.imag));
    }
    
    //false
    public static bool operator !=(Complex c1, Complex c2)
    {
      return ((c1.real != c2.real) || (c1.imag != c2.imag));
    }
   

    public override string ToString()
    {
      return string.Format("({0}+{1}X)",this.real,this.imag);
    }



  }

  class Program
  {
    static void Main(string[] args)
    {


      Complex c1 = new Complex(2, 5);

      Complex c2 = new Complex(1, 5);

      //if(c1!=c2) ==true
      

      //if (c1.Equals(c2)) 
      //{
        
      //}

      if (c1 == c2) // Default Equals meaning
      {
        Console.WriteLine("Equals!");
      }
      else 
      {
        Console.WriteLine(" Not Equals!");
      }
      

    }
  }
}
